package com.wen.service.Impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.wen.mapper.StockMapper;

import com.wen.pojo.Stock;

import com.wen.pojo.vo.StockVo;
import com.wen.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements StockService {
    @Autowired
    private StockMapper mapper;

    @Override
    public boolean StoUp(Long event, Long id) {
        boolean flag = mapper.StoUp(event, id);
        if (flag)
            return true;
        return false;
    }

    @Override
    public Page<Stock> pageListStock(StockVo stockVo, Long pageNum, Long pageSize) {
        Page<Stock> stockPage = new Page<>(pageNum, pageSize);
        Page<Stock> pageListStock = mapper.pageListStock(stockPage,stockVo);
        return pageListStock;
    }
}
